home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 014 / pibcat.arc / PIBCAT.GLO < prev    next >
Encoding:
Text File  |  1987-01-20  |  6.5 KB  |  151 lines

  1. (*----------------------------------------------------------------------*)
  2. (*                   GLOBAL VARIABLE DEFINITIONS                        *)
  3. (*----------------------------------------------------------------------*)
  4.  
  5. CONST
  6.                    (* 8086/8088 hardware flags *)
  7.  
  8.    Carry_Flag     = 1;
  9.    Parity_Flag    = 4;
  10.    Aux_Carry_Flag = 16;
  11.    Zero_Flag      = 64;
  12.    Sign_Flag      = 128;
  13.  
  14. TYPE
  15.  
  16.    AnyStr   = STRING[255]  (* Matches any string for parameter passing *);
  17.  
  18.    String2  = STRING[2]    (* Two character string *);
  19.  
  20.    FileStr  = STRING[65]   (* File name string *);
  21.  
  22.    RegPack  = RECORD       (* 8086/8088 registers                      *)
  23.                  CASE INTEGER OF
  24.                     1: ( Ax, Bx, Cx, Dx, Bp, Si, Di, Ds, Es, Flags : INTEGER );
  25.                     2: ( Al, Ah, Bl, Bh, Cl, Ch, Dl, Dh            : BYTE    );
  26.               END;
  27.  
  28.    Text_File = TEXT [4096]   (* General text file                 *);
  29.  
  30.    LongInt   = RECORD       (* 32 bit long INTEGER type *)
  31.                   Low  : INTEGER;
  32.                   High : INTEGER;
  33.                END;
  34.  
  35. (*----------------------------------------------------------------------*)
  36. (*                  Map of MsDos Directory Entry                        *)
  37. (*----------------------------------------------------------------------*)
  38.  
  39. TYPE
  40.  
  41.    Directory_Record = RECORD
  42.                          Filler    : ARRAY[1..21] Of BYTE;
  43.                          File_Attr : BYTE      (* File attributes *);
  44.                          File_Time : INTEGER   (* Creation time   *);
  45.                          File_Date : INTEGER   (* Creation date   *);
  46.                          File_Size : LongInt   (* Size in bytes   *);
  47.                          File_Name : ARRAY[1..80] Of CHAR (* Name *);
  48.                       END;
  49.                                    (* File attribute values *)
  50. CONST
  51.    Dir_Attr_Read_Only    =  1;
  52.    Dir_Attr_Hidden       =  2;
  53.    Dir_Attr_System       =  4;
  54.    Dir_Attr_Volume_Label =  8;
  55.    Dir_Attr_Subdirectory = 16;
  56.    Dir_Attr_Archive      = 32;
  57.  
  58.                                    (* File access modes *)
  59.    Access_Read_Mode           = 0;
  60.    Access_Write_Mode          = 1;
  61.    Access_Read_And_Write_Mode = 2;
  62.  
  63.                                    (* File attributes *)
  64.    Attribute_None             = 0;
  65.    Attribute_Read_Only        = 1;
  66.    Attribute_Hidden           = 2;
  67.    Attribute_System           = 4;
  68.    Attribute_Volume_Label     = 8;
  69.    Attribute_Subdirectory     = 16;
  70.    Attribute_Archive          = 32;
  71.  
  72. (*----------------------------------------------------------------------*)
  73. (*                  Error types for .ARC and .LBR files                 *)
  74. (*----------------------------------------------------------------------*)
  75.  
  76. CONST
  77.    Open_Error    = 1               (* Error when opening file    *);
  78.    Format_Error  = 2               (* .ARC/.LBR format bad       *);
  79.    End_Of_File   = 3               (* End of .ARC/.LBR directory *);
  80.  
  81. (*----------------------------------------------------------------------*)
  82. (*                    Global program variables                          *)
  83. (*----------------------------------------------------------------------*)
  84.  
  85. CONST
  86.    FF_Char               : CHAR = ^L        (* Form feed character      *);
  87.  
  88. VAR
  89.    Cat_Drive             : CHAR             (* Drive to catalog         *);
  90.    Output_File           : Text_File        (* File to receive output   *);
  91.    Output_File_Name      : AnyStr           (* Output file name         *);
  92.    Do_Printer_Format     : BOOLEAN          (* Format for printer       *);
  93.    Left_Margin           : INTEGER          (* Left margin              *);
  94.    Page_Size             : INTEGER          (* Page size for output     *);
  95.    Expand_Arcs           : BOOLEAN          (* TRUE to expand .ARC/.LBR *);
  96.    Left_Margin_String    : AnyStr           (* Blanks for left margin   *);
  97.    ArcLbr_Indent         : INTEGER          (* Indent for .ARC/.LBR     *);
  98.    User_Break            : BOOLEAN          (* TRUE if ^C stops liting  *);
  99.    Find_Spec             : AnyStr           (* File spec for listing    *);
  100.    Total_Files           : REAL             (* Total files found        *);
  101.    Total_Space           : REAL             (* Total space used         *);
  102.    Total_Dirs            : REAL             (* Total dirs scanned       *);
  103.    Page_Number           : INTEGER          (* Current page number      *);
  104.    Lines_Left            : INTEGER          (* Lines left on cur. page  *);
  105.    Help_Only             : BOOLEAN          (* TRUE if doing help only  *);
  106.  
  107. (*----------------------------------------------------------------------*)
  108. (*                  Titles and subtitles for paginated listings         *)
  109. (*----------------------------------------------------------------------*)
  110.  
  111. VAR
  112.    Volume_Title : AnyStr           (* Main title for entire listing *);
  113.    Subdir_Title : AnyStr           (* Current subdirectory title    *);
  114.    File_Title   : AnyStr           (* Current .ARC/.LBR file if any *);
  115.  
  116. (*----------------------------------------------------------------------*)
  117. (*                  Saved file names from nested directories            *)
  118. (*----------------------------------------------------------------------*)
  119.  
  120. CONST
  121.    MaxFiles              = 2048             (* Maximum files handled    *);
  122.  
  123. TYPE
  124.  
  125.    Short_Dir_Record = RECORD
  126.                          File_Attr : BYTE        (* File attributes *);
  127.                          File_Time : INTEGER     (* Creation time   *);
  128.                          File_Date : INTEGER     (* Creation date   *);
  129.                          File_Size : LongInt     (* Size in bytes   *);
  130.                          File_Name : STRING[12]  (* File name       *);
  131.                       END;
  132.  
  133. VAR
  134.                                    (* List of files in current and all *)
  135.                                    (* previous directories along path  *)
  136.                                    (* back to root directory.          *)
  137.  
  138.    File_Stack : ARRAY[1..MaxFiles] OF Short_Dir_Record;
  139.  
  140.                                    (* # of files currently saved       *)
  141.    File_Count : INTEGER;
  142.  
  143. (*----------------------------------------------------------------------*)
  144. (*                  Names of the months for date conversions            *)
  145. (*----------------------------------------------------------------------*)
  146.  
  147. (* STRUCTURED *) CONST
  148.    Month_Names : ARRAY[1..12] OF STRING[3] =
  149.                  ('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
  150.                   'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' );
  151.